#include "pMaterial.h"

using namespace Tmpl8;

pMaterial::pMaterial(float aFriction, float aRestitution, float aDensity, bool aIsTrigger)
{
	Init(aFriction, aRestitution, aDensity, aIsTrigger);
}

pMaterial::pMaterial(b2FixtureDef aFixture)
{
	mFixture = aFixture;
	mFixture.userData = this;
}

void pMaterial::Init(float aFriction, float aRestitution, float aDensity, bool aIsTrigger)
{
	SetFriction(aFriction);
	SetRestitution(aRestitution);
	SetDensity(aDensity);
	SetIsTrigger(aIsTrigger);
}

void pMaterial::SetFriction(float aFriction)
{
	mFixture.friction = aFriction;
}
float pMaterial::GetFriction()
{
	return mFixture.friction;
}
void pMaterial::SetRestitution(float aRestitution)
{
	mFixture.restitution = aRestitution;
}
float pMaterial::GetRestitution()
{
	return mFixture.restitution;
}
void pMaterial::SetDensity(float aDensity)
{
	mFixture.density = aDensity;
}
float pMaterial::GetDensity()
{
	return mFixture.density;
}
void pMaterial::SetIsTrigger(bool aIsTrigger)
{
	mFixture.isSensor = aIsTrigger;
}
bool pMaterial::GetIsTrigger()
{
	return mFixture.isSensor;

}
